<%@ page language="java"
	import="java.util.*,com.telecom.cms.util.*,com.telecom.tree.*"
	pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>输入查询目的：</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" type="text/css" href="images/main.css">
		<style type="text/css">
body {
	FONT-SIZE: 12px;
}
</style>
		<script type="text/javascript" src="js/dtree.js"></script>
		<script type="text/javascript">
/********************************************************
验证目的的js
author:王新强
********************************************************/
function submitit(){
	var reg1 = new RegExp("^[A-Za-z0-9]+$","");
	var reg2 = new RegExp("([a-zA-Z0-9])\\1{9}","");
	var reg3 = new RegExp("([\\u4e00-\\u9fa5])\\1{7}", "");
	b=document.getElementById("purpose").value;
	c=reg1.test(b);
	d=reg2.test(b);
	e=reg3.test(b);
	if(d||e||c){
		document.getElementById("errortip").style.display="";
		return false;
	}else{
		return true;
	}
}
function cancelit(){
	window.close();
}
function sizecheck(o){
	num=o.value.length;
	if(num>=16){
		document.getElementById("sub").disabled=false;
	}else{
		document.getElementById("sub").disabled=true;
	}
}
/*****************************************************
保存热点收藏的js
author:王新强
*****************************************************/		
var checkedbox=null;
function trim(str){  //删除左右两端的空格
		return str.replace(/(^\s*)|(\s*$)/g, "");
}
function bconfirm(){
	if(document.getElementById("checkshoucang").checked)
	    {
    	var foldername = document.getElementById("inboxname").value;
		var box= document.getElementsByName("parFolder");
		var a=trim(foldername);
		if(a==""){
  			alert("请输入文件名!");
  			return null;
 		}
		for(var i=0;i<box.length;i++){
			if(box[i].checked){
				var parfolderid=box[i].value;
			}
		}
		if(parfolderid==null){
			alert("请选择保存路径!");
			return null;
		}
			document.all.parfolderid.value=parfolderid;
			document.all.foldername.value=foldername;
/*			功能:设定添加的是文件夹
			var c=document.all.isfolder.checked;
			if(c==true)
			{	
				document.all.isFold.value="isFolder"
			}else{
				document.all.isFold.value="no"
			}
*/
			document.form1.action="collection.do" ;
			document.form1.target="mainFrame";
			document.form1.submit();
			window.parent.frames['leftFrame'].location.reload();
   		}
   		if(submitit()){
   			window.location.href="cluster/querywaitting.jsp?purpose="+document.getElementById("purpose").innerHTML;
   		}
}
function bcancel(){
	window.close();
}
function change(checkbox){
	if(checkedbox!=null){
	checkedbox.checked=false;
}
checkbox.checked=true;
	checkedbox=checkbox;
}

//用于弹出热点收藏
function pupl(o){
	if(o.checked){
		document.getElementById("shoucang").style.display="";
	}else{
		document.getElementById("shoucang").style.display="none";
	}
}
	</script>
		<link rel="stylesheet" type="text/css" href="css/button.css">
	</head>

	<body>
		<script type="text/javascript">
	window.parent.topFrame.step3pic.src="../images/step3_on.jpg";
	window.parent.topFrame.tips.innerHTML="<b>提交查询</b> <br> 填写本次提取用户清单的目的，以便我们做更好的改进，确定是否添加为主题收藏，提交本次查询。";
	</script>
		<br>
		<br>
		<form name="form1" action="query.do">
			<div
				style="border: 1px orange solid; height: 40px; width: 780px; float: left;">
				<div style="width: 100%;">
					请输入本次取数的目的,以便我们做出更好的改进以方便您的使用！
					<br>
					中文不要少于8个字,全部不要少于16个字。
					<div id="errortip" style="display: none">
						<font color="red"> 不允许这样输入!请您准确输入目的!</font>
					</div>
					<table align="left">
						<tr align="center">
							<td colspan="2">
								<textarea id="purpose" name="purpose"
									onpropertychange="sizecheck(this)" rows="10" cols="54"></textarea>
							</td>
							<td>
								<input class="btn_mouseout" type="button"
									style="width: 50px; height: 50px;" disabled id="sub" value="提交"
									onmouseover="this.className=&#39;btn_mouseover&#39;"
									onmouseout="this.className=&#39;btn_mouseout&#39;"
									onmousedown="this.className=&#39;btn_mousedown&#39;"
									onmouseup="this.className=&#39;btn_mouseup&#39;"
									onclick="bconfirm()">
							</td>
						</tr>
					</table>
				</div>
				请选择是否保存为主题收藏:
				<input type="checkbox" name="checkshoucang" id="checkshoucang"
					onclick="pupl(this)">
				<div
					style="width: 456px; display: none; border-top: orange 1px solid; border-right: orange 1px solid;"
					id="shoucang">
					<table align="left" width="456">
						<tr>
							<td bgcolor="#f7f7f7">
								<FONT face="Arial, Helvetica, sans-serif"><b>
										请输入新主题收藏的名称: </B> </FONT>
							</td>
						</tr>
						<tr>
							<td>
								<INPUT id=inboxname type=text name=inboxname size=54>
								<%
									String kindId = (String) session.getAttribute("kindId");
							        List userFolderTree = TreeUtil.retrieveNodeInfos(
									Constant.SEG_USER_FOLDER_DEF, kindId);
								%>
							</td>
						</tr>
						<tr>
							<td>
								<FONT face="Arial, Helvetica, sans-serif"><b>
										请选择新主题收藏的路径:</b> </font>
							</td>
						</tr>
						<tr height="300">
							<td align="left" style="PADDING-TOP: 3px" valign="top">
								<script>
						<%=TreeUtil.createBoxTreeInfo(userFolderTree, "parFolder")%>
					</script>
							</td>
						</tr>
					</table>
				</div>
				<input type="hidden" name="foldername">
				<input type="hidden" name="parfolderid">
			</div>
		</form>
	</body>
</html>
